<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_course_member".
 *
 * @property string $id
 * @property string $user_id 用户ID
 * @property string $class_id
 * @property string $course_id 课程ID
 * @property int $sort 排序
 * @property string $status 学习/取消
 * @property string $type
 * @property string $create_by 创建人ID
 * @property string $create_time 创建时间
 * @property string $update_by 修改人ID
 * @property string $update_time 修改时间
 * @property int $del_flag 删除状态
 * @property double $learning_rate 学习总进度
 * @property double $empirical 获得经验值
 * @property string $old_id 对应3.0的选课id
 */
class TCourseMember extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_course_member';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['sort', 'del_flag'], 'integer'],
            [['create_time', 'update_time'], 'safe'],
            [['learning_rate', 'empirical'], 'number'],
            [['id', 'user_id', 'class_id', 'course_id', 'create_by', 'update_by', 'old_id'], 'string', 'max' => 36],
            [['status', 'type'], 'string', 'max' => 64],
            [['id'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_id' => 'User ID',
            'class_id' => 'Class ID',
            'course_id' => 'Course ID',
            'sort' => 'Sort',
            'status' => 'Status',
            'type' => 'Type',
            'create_by' => 'Create By',
            'create_time' => 'Create Time',
            'update_by' => 'Update By',
            'update_time' => 'Update Time',
            'del_flag' => 'Del Flag',
            'learning_rate' => 'Learning Rate',
            'empirical' => 'Empirical',
            'old_id' => 'Old ID',
        ];
    }
}
